<?php
	require_once('../Model/getconfig.php');	
	$arrUsers=array();

	if(isset($_POST['username'])) $strusername=$_POST['username'];
	if(isset($_POST['password'])) $strpassword=$_POST['password'];
	//echo "uname:".$strusername;
	//echo "password:".$strpassword;

  
   // $arrUsers=Model_Admin::checkUser($strusername,$strpassword); 
 	$arrMenu=Model_admin::checkUser($strusername,$strpassword); 
	//echo "haii".count($arrMenu);
	if(count($arrMenu)>0){
		$objMemmaster=$arrMenu[0];
		$_SESSION['adminid']=$objMemmaster->getuserid();
		$_SESSION['adminuser']=$objMemmaster->getUsername();
		Jscript_phpjs::redirect('login_index.php?VL=loginarea');
		
		echo 'success';
	}
	else{
	
			$hasError = true;				
			$errorMessage = "Invalid Admin username or Admin password( Username or password not matching to our database details)!";
 ?>
	<div class="error_box">
		There was an error submitting the form.
		<br />
		<?php echo $errorMessage;?>
	</div>
<?php 
	
		}

?>